from charmicat import Cut

from cmix.parameters import paramdef

cuts = [Cut(name='fitret_eq_0',
            desc='Events where all vertex fits return 0',
            pos_str='(rs_dvf_ret == 0) & (ws_dvf_ret == 0)',
            ),
        Cut(name='nsvd_hits',
            desc='Events with at least one SVD hit in r-phi and two in z',
            pos_str=' & '.join(['(pos_svd_nhits_rphi > 0)',
                                '(pos_svd_nhits_z > 1)',
                                '(neg_svd_nhits_rphi > 0)',
                                '(neg_svd_nhits_z > 1)',
                                ])
            ), 
        Cut(name='q_rs_2sig',
            desc='Select events with Q off RS Kpi to be within ' + \
                '2 sigma of 5.85 MeV',
            pos_str='(abs(q_rs - Q_CENTROID) < 2*Q_SIGMA)',
            condvars=paramdef,
            ),                
        Cut(name='m_rs_d0_2sig',
            desc='Select events with m_rs within 2 sigma ' + \
                'of the D0 mass',
            pos_str='(abs(m_rs - D0_MASS) < 2*D0_SIGMA_MC)',
            condvars=paramdef,
            ),
        Cut(name='rs_dvf_cl_gt_0.1',
            desc='Select events where the D vertex fit CL is > 0.1',
            pos_str='(rs_dvf_cl > 0.1)',
            ),            
        ]
